package com.ruoyi.project.manage.animal.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.manage.animal.mapper.DwRareAnimalMapper;
import com.ruoyi.project.manage.animal.domain.DwRareAnimal;
import com.ruoyi.project.manage.animal.service.IDwRareAnimalService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 珍奇动物Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-04
 */
@Service
public class DwRareAnimalServiceImpl implements IDwRareAnimalService 
{
    @Autowired
    private DwRareAnimalMapper dwRareAnimalMapper;

    /**
     * 查询珍奇动物
     * 
     * @param id 珍奇动物主键
     * @return 珍奇动物
     */
    @Override
    public DwRareAnimal selectDwRareAnimalById(Integer id)
    {
        return dwRareAnimalMapper.selectDwRareAnimalById(id);
    }

    /**
     * 查询珍奇动物列表
     * 
     * @param dwRareAnimal 珍奇动物
     * @return 珍奇动物
     */
    @Override
    public List<DwRareAnimal> selectDwRareAnimalList(DwRareAnimal dwRareAnimal)
    {
        return dwRareAnimalMapper.selectDwRareAnimalList(dwRareAnimal);
    }

    /**
     * 新增珍奇动物
     * 
     * @param dwRareAnimal 珍奇动物
     * @return 结果
     */
    @Override
    public int insertDwRareAnimal(DwRareAnimal dwRareAnimal)
    {
        dwRareAnimal.setCreateTime(DateUtils.getNowDate());
        return dwRareAnimalMapper.insertDwRareAnimal(dwRareAnimal);
    }

    /**
     * 修改珍奇动物
     * 
     * @param dwRareAnimal 珍奇动物
     * @return 结果
     */
    @Override
    public int updateDwRareAnimal(DwRareAnimal dwRareAnimal)
    {
        return dwRareAnimalMapper.updateDwRareAnimal(dwRareAnimal);
    }

    /**
     * 批量删除珍奇动物
     * 
     * @param ids 需要删除的珍奇动物主键
     * @return 结果
     */
    @Override
    public int deleteDwRareAnimalByIds(String ids)
    {
        return dwRareAnimalMapper.deleteDwRareAnimalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除珍奇动物信息
     * 
     * @param id 珍奇动物主键
     * @return 结果
     */
    @Override
    public int deleteDwRareAnimalById(Integer id)
    {
        return dwRareAnimalMapper.deleteDwRareAnimalById(id);
    }
}
